package com.example.blog.service;

import com.example.blog.entity.User;
import com.example.blog.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public User selectUser(String username,String password) {
        return userMapper.selectUser(username,password);
    }
    public User selectByUserId(Integer userid) {
        return userMapper.selectByUserId(userid);
    }
    public void addUser(String username,String password) {
        userMapper.addUser(username,password);
    }
    public void upUser(String username,String password) {
        userMapper.upUser(username,password);
    }
    public User selectByUserName(String username) {
        return userMapper.selectByUserName(username);
    }
    public int getBlogNum(Integer userid) {
        return userMapper.getBlogNum(userid);
    }
}
